<template>
  <div class="page-container">
    <header class="header" :class="{ 'show-header': showHeader }">
      <div class="logo">AI 家居平台</div>
      <nav class="nav">
        <button class="nav-btn">反馈</button>
        <button class="nav-btn">了解</button>
        <button class="nav-btn" @click="StartLogin()">Get Start</button>
      </nav>
    </header>
    <div class="divider"></div>
    <main class="main-content">
      <div class="content-left">
        <div class="welcome-container swing-out-top-bck">
          <h1 class="welcome-text">欢迎加入 AI-Home-Platform</h1>
        </div>
        <div class="welcome-text-new">
          <div class="welcome-line">欢迎加入</div>
          <div class="welcome-line">AI-Home-Platform</div>
        </div>
        <img src="../assets/1.jpg" class="welcome-image" id="scrolling-mouse" alt="Welcome Image">
      </div>
    </main>
    <div class="divider bottom-divider"></div>
  </div>
</template>

<script setup>
import {ref, onMounted, computed, reactive} from 'vue'
import { message } from 'ant-design-vue';
import router from "../router";
const showHeader = ref(false)

onMounted(() => {
  setTimeout(() => {
    showHeader.value = true
  }, 3000) // 3.5s后显示header，与container-expand动画结束时间一致
})
const  StartLogin = ()=>{
  router.push('/Login_Register_Page')
}
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}

.page-container {
  min-height: 120vh;
  width: 100%;
  background-color: #f7f4ed;
  position: relative;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  transform: translateY(-100%);
  transition: transform 0.8s ease;
  background-color: rgba(247, 244, 237, 0.9);
  backdrop-filter: blur(5px);
}

.header.show-header {
  transform: translateY(0);
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: transparent;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.nav-btn:hover {
  background-color: rgba(0,0,0,0.1);
}

.divider {
  width: 100%;
  height: 1px;
  background-color: #ddd;
  position: relative;
  z-index: 1500;
}

.bottom-divider {
  position: fixed;
  bottom: 0;
}

.main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 200px);
  position: relative;
  z-index: 800;
}

.content-left {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.welcome-container {
  z-index: 888;
  width: 600px;
  height: 150px;
  background-color: #90EE90;
  border-radius: 7px;
  position: relative;
  overflow: hidden;

}
.swing-out-top-bck {
  -webkit-animation: swing-out-top-bck 2.45s cubic-bezier(0.600, -0.280, 0.735, 0.045) both;
  animation: swing-out-top-bck 2.45s cubic-bezier(0.600, -0.280, 0.735, 0.045) both;
}

.welcome-container.fade-out {
  background-color: transparent; /* Make background transparent when text is wiped out */
}

.welcome-text {
  font-size: 32px;
  text-align: center;
  padding: 20px;
  animation: wipe-out 2.5s forwards;
}

.welcome-text-new {
  z-index: 999;
  color: whitesmoke;
  font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-weight: 900;
  position: absolute;
  left: 180px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  animation: text-appear 0.5s 3.5s forwards;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.welcome-line {
  font-size: 76px;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.welcome-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 125%;
  object-fit: cover;
  opacity: 0;
  animation: image-appear 1.0s 2.7s forwards;
}
.login-panel-background {
  z-index: 999;
  position: absolute;
  border-radius: 12px;
  top: 25%;
  left: 34%;
  width: 30%;
  height: 30%;
  background: linear-gradient(135deg,
  rgba(0, 210, 255, 0.4) 0%,
  rgba(58, 123, 213, 0.5) 50%,
  rgba(0, 31, 63, 0.6) 100%
  );
  backdrop-filter: blur(15px);
  box-shadow:
      0 0 20px rgba(0, 210, 255, 0.2),
      inset 0 0 15px rgba(58, 123, 213, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* 添加机械风格边框效果 */
  &::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
    transparent 0%,
    rgba(0, 210, 255, 0.2) 45%,
    rgba(0, 210, 255, 0.4) 50%,
    rgba(0, 210, 255, 0.2) 55%,
    transparent 100%
    );
    border-radius: inherit;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
  }
}

.login-panel {
  position: absolute;
  width: 60%;
  height: 90%;
  top: 5%;
  left: 20%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow:
      0 0 10px rgba(0, 210, 255, 0.1),
      inset 0 0 5px rgba(58, 123, 213, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  &:hover {
    transform: translateY(-2px);
    box-shadow:
        0 5px 15px rgba(0, 210, 255, 0.2),
        inset 0 0 8px rgba(58, 123, 213, 0.3);
  }
}
@-webkit-keyframes swing-out-top-bck {
  0% {
    -webkit-transform: rotateX(0deg);
    transform: rotateX(0deg);
    -webkit-transform-origin: top;
    transform-origin: top;
    opacity: 1;
  }
  100% {
    -webkit-transform: rotateX(-100deg);
    transform: rotateX(-100deg);
    -webkit-transform-origin: top;
    transform-origin: top;
    opacity: 0;
  }
}
@keyframes swing-out-top-bck {
  0% {
    -webkit-transform: rotateX(0deg);
    transform: rotateX(0deg);
    -webkit-transform-origin: top;
    transform-origin: top;
    opacity: 1;
  }
  100% {
    -webkit-transform: rotateX(-100deg);
    transform: rotateX(-100deg);
    -webkit-transform-origin: top;
    transform-origin: top;
    opacity: 0;
  }
}

@keyframes wipe-out {
  0% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes text-appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes image-appear {
  0% {
    opacity: 0;
    clip-path: inset(50% 50% 50% 50%);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}
</style>
